package com.litchi.aopdemo;

import com.litchi.aopdemo.dao.UserDao;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class AopDemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(AopDemoApplication.class, args);
        // 从Spring容器中获得内容
        UserDao userDaoProxy = (UserDao) run.getBean("userDao");
        // 执行方法
        userDaoProxy.addUser();
        userDaoProxy.deleteUser();
    }

}
